#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
//#include "BookFunction.h"
#include "MallFunction.h"
using namespace std;
int a,q;
string b,c,d, e;
int x,y =0,z;
MyBookStore nds, gba;
Book ndsl;
MyShoppingMall FullyBooked;
string TitleSearch, AuthorSearch;
string input;

int main()
{
    cout<<"Welcome to A Simple User Interface"<< endl;
    cout <<"Please Enter Store Name" << endl;
    cin >> input;
    nds = MyBookStore(input);
    x=1;
    while (x!=0)
    {
        
        cout<< "Please Enter the Appropriate Number for you Function of Choice" << endl;
        cout<< "(1) Add a Book" << endl;
        cout<< "(2) Name the Store" << endl;
        cout<< "(3) Display Index" << endl;
        cout<< "(4) Search Using Title" << endl;
        cout<< "(5) Search Using Author" << endl;
        cout<< "(6) Delete a Book" << endl;
        cout<< "(7) Add a Bookstore to the Mall" << endl;
        cout<< "(8) Display Mall Index" << endl;
        cout<< "(0) Exit the Program" << endl;
        cin >> x;
        switch(x)
        {
            case 1:
            cout << "Input Book ID" << endl;
            cin >> a;
            cout << "Input Book Name" << endl;
            cin >> b;
            cout << "Input Author First Name" << endl;
            cin >> c;
            cout << "Input Author Last Name" << endl;
            cin >> d;
            ndsl = Book(a,b,c,d);
                nds.AddBook(ndsl);
                break;
            case 2:
                cout <<" Please Enter Store Name" << endl;
                cin >> input;
                nds.StoreName;
                break;
            case 0:
                cout << "Thank You for Using This Product" << endl;
                return 0;
                break;
            case 3:
                cout << "Input index Number" << endl;
                cin >> z;
                cout << "Title of Book " << nds.DisplayTitle(z) << endl;
                break;
            case 4:
                cout << "Input Title to be Searched" <<endl;
                cin >> e ;
             //  cout << "Result is " << nds.SearchTitle(e) << endl;
              cout<< nds.SearchTitle(e).BookName<<endl;
              break;
            case 5:
                cout << "Input First Name to be Searched" << endl;
                cin >> c;
                cout << "Input Second Name to be Searched" << endl;
                cin >> d;
                cout << "Resulting Book is : " << nds.SearchAuthor(c,d).BookName << endl;
                break;
            case 6:
                cout << "Input index Number of Book to be Deleted" << endl;
                cin >> z;
                cout << "Deleted Book: " << nds.DeleteBook(z).BookName << endl;
                break;
            case 7:
                cout << "Please Name The Store to Be Added" << endl;
                cin >> input;
                gba = MyBookStore(input);
                FullyBooked.AddBookStore(gba);
                break;
            case 8:
                cout << "Input Index to be Searched in the Mall" << endl;
                cin >> z;
                cout << "Store Name is: " << FullyBooked.DisplayStore(z)<< endl;
                break;
        }
        
        
    }
return 0;    
}

